﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GnufBase.h"
#include "GnufToolButton.h"
#include "GnufObjectPtr.h"

namespace gnuf {
    class GNUF_BASE_EXPORT ComboBoxButton 
        : public ToolButton
    {
    public:
        static const EItemType Type;

        explicit ComboBoxButton(Item * pParent);
        explicit ComboBoxButton(Item * pParent, EItemType, const char *);
        virtual ~ComboBoxButton();

        void setCurrentItem(Item*);
        void setCurrentIndex(int index);

        virtual void onDropDownBoardItemClicked(Item*) override;
    private:
        void changeSelectedButton(ButtonEx*);
        ObjectWeakPtr<ButtonEx> m_wpCurrBtn;
    };
}
